//
//  YCShopListCell.m
//  YCSchool
//
//  Created by gmall on 16/5/13.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//  商家列表--商家搜索

#import "YCShopListCell.h"

@implementation YCShopListCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        _headerImageView = [[UIImageView alloc] init];
//        _headerImageView.layer.cornerRadius = 57 / 2;
        _headerImageView.contentMode = UIViewContentModeScaleAspectFill;
//        _headerImageView.layer.masksToBounds  =YES;
        
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.textColor = [UIColor blackColor];
        _nameLabel.text = @"Gmall云南背包旅游";
        _nameLabel.font = [UIFont systemFontOfSize:15];
        
        _attentionImageView = [[UIImageView alloc] init];//16*18px
        _attentionImageView.image = [UIImage imageNamed:@"关注人数"];
    
        _attentionLabel = [[UILabel alloc] init];
        _attentionLabel.text = @"关注人数 750";
        _attentionLabel.font = [UIFont systemFontOfSize:9];
        _attentionLabel.textColor = [UIColor yc_colorWithUInt:0x00b4ff];
        
        
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.textColor = [UIColor yc_colorWithUInt:0xcccccc];
        _contentLabel.text = @"不一样的旅行,不一样的人生...";
        _contentLabel.font = [UIFont systemFontOfSize:14];
        
        [self.contentView addSubview:self.headerImageView];
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.attentionImageView];
        [self.contentView addSubview:self.attentionLabel];
        [self.contentView addSubview:self.contentLabel];
        
        [self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.left.equalTo(self.contentView).offset(15);
            make.width.height.equalTo(@57);
        }];
        
        [self.attentionImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.headerImageView);
            make.left.equalTo(self.headerImageView.mas_right).offset(10);
            make.height.equalTo(@9);
            make.width.equalTo(@8);
        }];
        
        [self.attentionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.headerImageView);
            make.left.equalTo(self.attentionImageView.mas_right).offset(2);
        }];
        
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.attentionImageView.mas_top).offset(-8);
            make.left.equalTo(self.headerImageView.mas_right).offset(10);
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.attentionImageView.mas_bottom).offset(7);
            make.left.equalTo(self.headerImageView.mas_right).offset(10);
            make.right.equalTo(self.contentView).offset(- 15);
        }];
        
    }
    return self;
}



@end
